from django.db import models
from django.contrib.auth.models import User


class Profile(models.Model):
    nickname = models.CharField(max_length=100, blank=False, default="Unknown")  # 昵称，必填
    full_name = models.CharField(max_length=100, blank=False, default="Unknown")  # 姓名，必填
    education = models.CharField(max_length=100, blank=False, default="Unknown")  # 学历，必填
    interested_position = models.CharField(max_length=100, blank=False, default="Unknown")  # 兴趣岗位，必填
    blog_or_repo_link = models.URLField(blank=True)  # 博客或仓库链接，可选
    resume = models.FileField(upload_to='resumes/', blank=True, null=True)  # PDF简历上传，可选
    work_experience = models.TextField(blank=True, null=True)  # 工作经验，仅加入企业的用户可填
    job_title = models.CharField(max_length=100, blank=True, null=True)  # 岗位，仅加入企业的用户可填
    company = models.CharField(max_length=100, blank=True, null=True)  # 企业

    def can_add_extra_info(self):
        return self.company is not None
